<template>
  <div class="whole">
    <div class="person">
      <div class="check-history"><span  @click="JumpName('jljsHistory')">查看历史<img src="https://img.wifenxiao.com/h5-wfx/images/DZ/jlsj/right.png"></span></div>
      <div class="infoPanel">
        <div class="phone"><img :src="headimgurl"></div>
        <div class="name">
          <div class="title">{{nickname}}</div>
          <div class="icon">{{title}}</div>
        </div>
      </div>
    </div>
    <div class="total">
      <div class="content">
        <img class="price-bg" src="https://img.wifenxiao.com/h5-wfx/images/DZ/jlsj/total-prices.png" />
        <div class="jackpot">
          <div class="now-title">当前奖池金额</div>
          <div class="money"><span>￥</span>{{jackpot_total_amount}}</div>
          <div class="person-title"><img src="https://img.wifenxiao.com/h5-wfx/images/DZ/jlsj/participants.png"></div>
          <div class="now-person">{{count}}<span>人</span></div>
        </div>
      </div>
      <div class="content top">
        <img class="price-bg" src="https://img.wifenxiao.com/h5-wfx/images/DZ/jlsj/expected-obtains.png" />
        <div class="jackpot">
          <div class="expected-title">预计获得</div>
          <div class="expected-money"><span>￥</span>{{bonus}}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { gzjlAgentBonus } from '@/api/dz/yjsjApi'

export default {
  data() {
    return {
      headimgurl: '',
      nickname: '',
      title: '',
      jackpot_total_amount: '',
      count: '',
      bonus: '',
      timeData: {}
    }
  },
  created() {
    this.getTime()
    this.init()
  },
  methods: {
    // 获取当前月份和前三个月份
    getTime() {
      const time = new Date()
      const currentYear = time.getFullYear()
      // 当前年月
      this.timeData.currentYear = currentYear
    },
    init() {
      const data = {
        value: '',
        year: this.timeData.currentYear
      }
      this.$loadingWrap.show()
      gzjlAgentBonus(data).then(res => {
        this.$loadingWrap.close()
        if (res.status == 1) {
          this.headimgurl = res.data.headimgurl
          this.nickname = res.data.nickname
          this.title = res.data.title
          this.jackpot_total_amount = res.data.jackpot_total_amount
          this.count = res.data.count
          this.bonus = res.data.bonus
        } else {
          this.$Error(res.msg)
        }
      })
    },
    JumpName(url, data) {
      this.$JumpName(this, url, data)
    }
  }
}
</script>
<style lang="scss">
.whole {
  position: absolute;
  left: 0;
  width:100%;
  height: 1334px;
  background: url("https://img.wifenxiao.com/h5-wfx/images/DZ/jlsj/redBg.png") top left no-repeat;
  background-size: 100% 100%;
  background-position-y: 310px;
}
.bg-whole {
  position: absolute;
  top: 310px;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("https://img.wifenxiao.com/h5-wfx/images/DZ/jlsj/redBg.png") top left no-repeat;
  background-size: 100% 100%;
  z-index: -1;
}
.person {
  background: url("https://img.wifenxiao.com/h5-wfx/images/DZ/jlsj/black-bg.png") top left no-repeat;
  background-size: 100% 100%;
  height: 310px;
  padding: 24px 32px 46px 24px;
  .check-history {
    color: #999;
    text-align: right;
    font-size: 24px;
    img {
      width: 24px;
      height: 24px;
      position: relative;
      top: 4px;
      left: 8px;
    }
  }
  .infoPanel {
    display: flex;
    align-items: center;
    .phone{
      img {
        width: 120px;
        height: 120px;
        border-radius: 50%;
      }
    }
    .name {
      margin-left: 16px;
      .title {
        font-size: 28px;
        color: #fff;
      }
      .icon {
        background: #ffe8db url("https://img.wifenxiao.com/h5-wfx/images/DZ/jlsj/fxs-icon.png") top left no-repeat;
        color: #C18963;
        background-size: 100% 100%;
        padding: 0px 20px 0px 50px;
        margin-top: 16px;
        font-size: 24px;
        height: 44px;
        line-height: 44px;
        border-radius: 50px
      }
    }
    
  }
}
  .total {
    z-index: 10;
    position: relative;
    top: -96px;
    margin: 0 54px;
    .content {
      position: relative;
      &.top {
        margin-top: 34px;
        margin-bottom: 60px;
      }
      .jackpot {
        position: absolute;
        left: 54px;
        top: 0;
        right: 54px;
        bottom: 0;
        text-align: center;
        font-weight: 600;
        .now-title{
          font-size: 36px;
          color: #F93B5A;
          line-height: 72px;
          margin-top: 12px;
        }
        .money {
          color: #F94661;
          font-size: 80px;
          margin: 60px 0 38px 0;
          span {
            font-size: 48px;
          }
        }
        .person-title {
          margin-bottom: 20px;
          img {
            width: 384px;
          }
        }
        .now-person {
          color: #F94661;
          font-size: 72px;
          span {
            font-size: 28px;
            color: #333;
            margin-left: 4px;
          }
        }
        .expected-title {
          color: #FEE9D9;
          font-size: 32px;
          font-weight: 600;
          margin-top: 16px;
        }
        .expected-money {
          margin-top: 144px;
          color: #A35E27;
          font-size: 80px;
          span {
            font-size: 48px;
          }
        }
      }
      .price-bg {
        width: 100%;
      }
    }
    
  }
</style>